<form id="addLicenseForm" action="{:U('License/add')}" method="post">
 <div class="content-head">
      <div class="finder-title">
		<h2 class="head-title">添加授权</h2>
        <ul class="msgtopbor">
			<li><span class="spfl">
			<span class="red">*</span>请选择客户：</span>
			<select name="customer_id" class="inp required">
				<option value=''>--请选择客户--</option>
				<volist name='customerList' id='vo'>
				  <option value='{$vo.id}'>{$vo.name}</option>
				</volist>
			</select>
			</li>
			<li><span class="spfl">
			<span class="red">*</span>请选择产品：</span>
			<select name="product_id" id='product_id' class="inp required">
				<option value=''>--请选择产品--</option>
				<volist name='productList' id='vo'>
				  <option value='{$vo.id}'>{$vo.name}</option>
				</volist>
			</select>
			<li><span class="spfl">
			<span class="red">*</span>请选择产品版本号：</span>
			<select name="version" class="inp required" id='version' sytle='width:100px;'>
				<option value=''>--请选择产品版本号--</option>
			</select>
			</li>
			<li><span class="spfl">
			<span class="red">*</span>请选择使用类型：</span>
			<select name="type" class="inp required">
				<option value=''>--请选择使用类型--</option>
				<option value='PRODUCT'>正式商用</option>
				<option value='TEST'>申请试用</option>
			</select>
			</li>
		   <li><span class="spfl">
			   <span class="red">*</span>开始日期:</span>
				 <input name="start_time" type="text" class="Wdate inp required"  onClick="WdatePicker()" id="start_time" size="30" />
			</li>
			<li><span class="spfl">
				<span class="red">*</span>结束日期：</span>
				   <input name="end_time" type="text" class="Wdate inp required" onClick="WdatePicker()" id="end_time" size="30"/>
			 </li>
              </ul>
           <div class="buttondiv"><button class="btn" id="newmember-edit-form-submit" type="submit"><span><span>保存</span></span></button></div>
          </div>
  </div>
</form>
  <script>
$(document).ready(function(){
   
	$('#product_id').change(function(){
		getProductVersion();
     });
	 $("#addLicenseForm").validate();
  });

function getProductVersion(){
	       var product_id = $('#product_id').val();
           $.ajax({
            url: "{:U('Version/getVersion')}",
            type: "get",
            dataType: "html",
            cache: false,
            data: "product_id=" + product_id,
            success: function(html) {
             $("#version").empty();//清空
			 $("#version").append(html);
            }
           });
}
</script>